	<div class="page-title">
		Pool administration &mdash;&gt; edit pool
	</div>

	<ng-include src="'/static/templates/pool_form.html'"></ng-include>

	<div id="pool_success_container" ng-show="edited_pools.length > 0">
		<div class="options-group">
			<div class="options-content">
				<h3 class="options-group-heading">Result</h3>
				<div id="pool_success_bg" ng-repeat="pool in edited_pools" style="padding: 15px; background-color: #ccffcc;">
					The pool {{ pool.name }} was successfully edited.
				</div>
			</div>
		</div>
	</div>

	<!-- statistics -->
	<div class="options-group">
		<div class="options-content">
			<h3 class="options-group-heading">Statistics for pool {{ pool.name }}</h3>

			<div class="option">
				<dl>
					<dt>
						IPv4 prefixes
					</dt>
					<dd>
						<span ng-show="pool.member_prefixes_v4 == 0 && pool.ipv4_default_prefix_length !== null">
							No IPv4 member prefixes.
						</span>
						<span ng-show="pool.ipv4_default_prefix_length === null">
							Unable to calculate number of total and free prefixes, IPv4 default prefix length is not set.
						</span>
						<span ng-show="pool.member_prefixes_v4 > 0 && pool.ipv4_default_prefix_length !== null">
							<canvas id="canvas_pool_prefixes_v4" style="float: right;" width="250px;" height="100"></canvas>
							Pool {{ pool.name }} consists of {{ pool.member_prefixes_v4 }}
							member IPv4 prefixes. There are {{ pool.used_prefixes_v4 }} used
							IPv4 prefixes (direct subnets) and {{ pool.free_prefixes_v4 }}
							free prefixes of the default IPv4 prefix length 
							({{ pool.ipv4_default_prefix_length }}) allowing for a total of
							{{ pool.total_prefixes_v4 }} prefixes.
						</span>
					</dd>
				</dl>
			</div>

			<div class="rule"></div>

			<div class="option">
				<dl>
					<dt>
						IPv6 prefixes
					</dt>
					<dd>
						<span ng-show="pool.member_prefixes_v6 == 0 && pool.ipv6_default_prefix_length !== null">
							No IPv6 member prefixes.
						</span>
						<span ng-show="pool.ipv6_default_prefix_length === null">
							Unable to calculate number of total and free prefixes, IPv6 default prefix length is not set.
						</span>
						<span ng-show="pool.member_prefixes_v6 > 0 && pool.ipv6_default_prefix_length !== null">
							<canvas id="canvas_pool_prefixes_v6" style="float: right;" width="250px;" height="100"></canvas>
							Pool {{ pool.name }} consists of {{ pool.member_prefixes_v6 }}
							member IPv6 prefixes. There are {{ pool.used_prefixes_v6 }} used
							IPv6 prefixes (direct subnets) and {{ pool.free_prefixes_v6 }}
							free prefixes of the default IPv6 prefix length 
							({{ pool.ipv6_default_prefix_length }}) allowing for a total of
							{{ pool.total_prefixes_v6 }} prefixes.
						</span>
					</dd>
				</dl>
			</div>

			<div class="rule"></div>

			<div class="option">
				<dl>
					<dt>
						IPv4 addresses
					</dt>
					<dd>
						<span ng-show="pool.member_prefixes_v4 == 0">
							No IPv4 member prefixes.
						</span>
						<span ng-show="pool.member_prefixes_v4 > 0">
							<canvas id="canvas_pool_addresses_v4" style="float: right;" width="250px;" height="100"></canvas>
							Pool {{ pool.name }} consists of {{ pool.member_prefixes_v4 }}
							IPv4 prefixes totalling {{ pool.total_addresses_v4 }} addresses.
							{{ pool.used_addresses_v4 }} addresses are in use while 
							{{ pool.free_addresses_v4 }} are free, representing a usage of
							{{ (pool.used_addresses_v4 / pool.total_addresses_v4 * 100) | number: 1 }}%.
						</span>
					</dd>
				</dl>
			</div>

			<div class="rule"></div>

			<div class="option">
				<dl>
					<dt>
						IPv6 addresses
					</dt>
					<dd>
						<span ng-show="pool.member_prefixes_v6 == 0">
							No IPv6 member prefixes.
						</span>
						<span ng-show="pool.member_prefixes_v6 > 0">
							<canvas id="canvas_pool_addresses_v6" style="float: right;" width="250px;" height="100"></canvas>
							Pool {{ pool.name }} consists of {{ pool.member_prefixes_v6 }}
							IPv6 prefixes totalling {{ pool.total_addresses_v6 }} addresses.
							{{ pool.used_addresses_v6 }} addresses are in use while 
							{{ pool.free_addresses_v6 }} are free, representing a usage of
							{{ (pool.used_addresses_v6 / pool.total_addresses_v6 * 100) | number: 1 }}%.
						</span>
					</dd>
				</dl>
			</div>
		</div>
	</div>

	<div class="options-group">
		<div class="options-content" style="position: relative;">
			<h3 class="options-group-heading">Prefixes in pool</h3>
			<div style="position: absolute; right: 20px; top: 48px; width: 100px;">
				<button class="btn btn-danger" ng-click="showExpandPoolNotice()">Expand pool</button>
			</div>
			<table id="pool_prefix_list" style=" margin-top: 40px; border-spacing: 0px; width: 100%;">
				<thead class="listing">
					<tr>
						<th>Prefix</th><th>Description</th><th>&nbsp;</th>
					</tr>
				</thead>
				<tbody class="listing">
					<tr ng-repeat="prefix in pool_prefixes">
						<td>{{ prefix.display_prefix }}</td>
						<td>{{ prefix.description }}</td>
						<td>
							<div uib-dropdown>
								<div uib-dropdown-toggle class="minibutton">
									<div class="popup_button_icon">&nbsp;</div>
								</div>
								<div uib-dropdown-menu class="popup_menu">
									<h3>Prefix</h3>
									<a href="" ng-click="prefixConfirmRemove($event, prefix)">Remove</a>
								</div>
							</div>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
	</div>

	<script type="text/ng-template" id="expand_pool_notice.html">
		<div class="modal-header">
			<h3 class="">Expanding pools</h3>
		</div>
		<div class="modal-body">
			Since version 0.27 pools are expanded from the prefix edit page.
			<img src="/static/images/expand_pool_notice.png">
			<div style="text-align: center">
				<button class="btn btn-primary" ng-click="$close()">OK, got it!</botton>
			</div>
		</div>
	</script>
